//通过函数while循环实现字符串拷贝函数
# include<stdio.h>
# include<string.h>

void cp_char(char *p,char *q)
{
	while (*p != 0 )
	{
		*q = *p;
		*p++;
		*q++;
	}
	*q = 0;
}
int main (void)
{
	char num[] = "abcdefg";
	char *p = NULL;
	char arr[100]= {0};
	p = arr;//一定要記得给p分配空间啊
	cp_char(num,p);

	printf ("%s\n",p);
	return 0;
}
